<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="{ADMIN_THEME}images/reset.css" rel="stylesheet" type="text/css" />
    <link href="{ADMIN_THEME}images/system.css" rel="stylesheet" type="text/css" />
    <link href="{ADMIN_THEME}images/dialog.css" rel="stylesheet" type="text/css" />
    <link href="{ADMIN_THEME}images/switchbox.css" rel="stylesheet" type="text/css" />
    <link href="{ADMIN_THEME}images/table_form.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="{ADMIN_THEME}js/jquery.min.js"></script>
    <script type="text/javascript" src="{ADMIN_THEME}js/dialog.js"></script>
    <script type="text/javascript">
        var sitepath = '{SITE_PATH}{ENTRY_SCRIPT_NAME}';
        var finecms_admin_document = "{$cats[$data['catid']]['setting']['document']}";
    </script>
    <script type="text/javascript" src="{LANG_PATH}lang.js"></script>
    <script type="text/javascript" src="{ADMIN_THEME}js/core.js"></script>
    <script type="text/javascript">
        function ajaxletter() {
            var letter = $('#letter').val();
            if (letter == '') {
                $.post(sitepath+'?c=api&a=pinyin&id='+Math.random(), { name:$('#name').val() }, function(data){ $('#letter').val(data); });
            }
        }
    </script>
    <script type="text/javascript">
        $(function() {

            dr_set_type('{$data["type"]}');
        });

        function dr_set_type(v) {
            $(".dr_hide").hide();
            $(".dr_"+v).show();
        }
    </script>
    <title>admin</title>
</head>
<body style="font-weight: normal;">
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href="{url('admin/wx/index')}"><em>素材列表</em></a><span>|</span>
        <a href="{url('admin/wx/add_resource')}"  class="on"><em>添加素材</em></a>
    </div>
    <div class="bk10"></div>
    <div class="table-list">
        <form action="" method="post">
            <input name="id" type="hidden" value="{$data['id']}">
            <table width="100%" class="table_form">

                <tr>
                    <th width="200">*标题： </th>
                    <td>
                        <input class="input-text" type="text" name="data[title]" value="{$data['title']}" id="name" size="30"/>
                    </td>
                </tr>

                <tr id="fine_images"><th>上传图片：</th><td><script type="text/javascript" src="/views/admin/js/jquery-ui.min.js"></script>
                    <input type="hidden" value="images" name="listfiles[]">
                    <fieldset class="blue pad-10">
                        <legend>列表</legend>
                        <div class="picList" id="list_images_files">
                            <ul id="images-sort-items">
                                {if $data['images']}
                                {php $i = 0;}
                                    {loop $data['images']['file'] $image}

                                        {php $id = rand(1,1000)}
                                        <li id="files_{$id}">
                                            <input type="text" class="input-text" style="width:310px;" value="{$image}" name="data[images][file][]">
                                            <input type="text" class="input-text" style="width:160px;" value="{$data['images']['alt'][$i]}" name="data[images][alt][]">
                                            <a href="javascript:removediv('{$id}');">移除</a>
                                            <a href="javascript:;" style="cursor:move;" title="鼠标拖动即可">排序</a>
                                        {php ++ $i;}
                                    {/loop}
                                {/if}
                            </ul>
                    </fieldset>
                    <div class="bk10"></div>
                    <div class="picBut cu"><a href="javascript:;" onClick="add_null_file('images')">添加地址</a></div>
                    <div class="picBut cu"><a href="javascript:;" onClick="uploadFiles('images','anBnLGpwZWcscG5nLGdpZg==|2')">批量上传</a></div>
                    <div class="onShow">前者表示文件地址，后者表示文件名称</div><script>$("#images-sort-items").sortable();</script><span id="ck_images"></span></td>
                </tr>

                <tr>
                    <th width="200">
                        *正文：
                    </th>
                    <td>
                        {php App::auto_load('fields');echo content_editor('content',array(0=> $data['content']), array('system'=>1,'pagebreak'=>1,'type' =>2,'height'=>'200'));}
                    </td>
                </tr>
                <tr>
                    <th width="200">
                        外部地址：
                    </th>
                    <td>
                        <input  class="input-text" type="text" name="data[url]" value="{$data['url']}" size="80">
                    </td>
                </tr>
                <tr>
                    <th></th>
                    <td>
                        <input  class="button" type="submit" name="submit" value="提交" size="80">
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
</body>
</html>